#pragma once
#include <vector>
#include "State.h"

namespace Putin{
/**
 * A generic state manager that can be used to implement 
 * a state machine.
 */
class StateManager
{
public:
	StateManager(void);
	virtual ~StateManager(void);
	
	/**
	 * Start the State machine
	 * @param state the state to start with
	 */
	virtual void start(State* state);
	
	/**
	 * Change the state, exit the last state and init the new one
	 * @param state the state to change to 
	 */
	virtual void changeState(State* state);

	/**
	 * Push a new state on top of the other one
	 * Pause the old and overrivde.
	 * @param state the state to override the current with
	 */
	virtual void pushState(State* state);
	
	/**
	 * Resume the last one on the stack
	 */
	virtual void popState();
	
	/**
	 * Update the current game state
	 */
	virtual void update();

protected:

	std::vector<State*> mStates;
};

}